package cn.lds.j367.ssm.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HomeController {

    private static final Logger log = LoggerFactory.getLogger(HomeController.class);

    @RequestMapping("/")
    public String home(){

        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        log.info("登录用户：" + authentication.getPrincipal());




        return "home";
    }
}
